from django.db import models

# Create your models here.
# 医生表:
# 		id int 主键 自增
# uname varchar(20) not null
# truename varchar(20) not null 医生姓名
# pwd char(32) not null,
# 处方表类型（数据类型自定义）:
# 		cname varchar(60) not null,
# result varchar(100) not null,
# doctor int(10)
# hname varchar(30) not null

class Doctor(models.Model):
    uname = models.CharField(max_length=20,null=False)
    pwd = models.CharField(max_length=32,null=False)
    truename = models.CharField(max_length=20,null=False)


class Recipe(models.Model):
    cname = models.CharField(max_length=60,null=False)
    result = models.CharField(max_length=100,null=False)
    doctor = models.ForeignKey(Doctor,on_delete=models.CASCADE)
    hname = models.CharField(max_length=30,null=False)
    # bid = models.ForeignKey(Doctor,on_delete=models.CASCADE)

